package cn.iocoder.yudao.module.api.brokerage.record.enums;

import cn.iocoder.yudao.framework.business.basic.enums.EnumValuable;
import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

/**
 * 分佣层级枚举
 *
 * @author owen
 */
@RequiredArgsConstructor
@Getter
public enum BrokerageBonusLevelEnum implements EnumValuable {

    NONE(0, ""),
    FATHER(1, "一级"),
    GRANDPA(2, "二级"),
    ;

    @EnumValue
    private final Integer value;
    private final String name;

    public static BrokerageBonusLevelEnum valueOf(Integer value) {
        for (BrokerageBonusLevelEnum item : values()) {
            if (item.getValue().equals(value)) {
                return item;
            }
        }
        return NONE;
    }

}
